<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>转正申请</title>
</head>
<body>
	<script type="text/javascript">
	$(function(){
		$('#standard_form').form('load','get_empinfo');
	})
	</script>
	<script type="text/javascript">
		$(function() {
			$("#standard_save").linkbutton({
				onClick : function() {
					$("#standard_form").form({
						url : "save_standard",
						success : function(data) {
							if (data=='true') {
								$("#standard_form").form("clear");
								//获取选中的面板
								var tab = $('#tt').tabs('getSelected');
								//根据选中的面板获取该面板的索引
								var index = $('#tt').tabs('getTabIndex',tab);
								//根据索引关闭
								if(index != 0){
									$('#tt').tabs('close',index);
								}
								$.messager.alert("消息","保存成功！");
							}else {
								$.messager.alert("保存失败",
										"可能原因：<br>"+
										"1、您的申请正在办理中，请勿重复申请<br>"+
										"2、您还没有录入档案，请先录入档案<br>"+
										"3、您已经是正式员工，无需转正");
							}
							
						}
					});
					var submit = $("#standard_form").form('enableValidation').form('validate');
					if (submit) {
						$.messager.confirm('消息', '您确定上传该流程吗？上传后无法修改！', function(r){
							if (r) {
								$("#standard_form").submit();
							}
						})
					}
				}
			});
			$("#standard_submit").linkbutton({
				onClick : function() {
					$("#standard_form").form({
						url : "submit_standard",
						onSubmit : function(params) {
							params.pk = 'standard_act';
						},
						success : function(data) {
							if (data=='true') {
								$("#standard_form").form("clear");
								//获取选中的面板
								var tab = $('#tt').tabs('getSelected');
								//根据选中的面板获取该面板的索引
								var index = $('#tt').tabs('getTabIndex',tab);
								//根据索引关闭
								if(index != 0){
									$('#tt').tabs('close',index);
								}
								$.messager.alert("消息","保存成功！");
							}else {
								$.messager.alert("保存失败",
										"可能原因：<br>"+
										"1、您的申请正在办理中，请勿重复申请<br>"+
										"2、您还没有录入档案，请先录入档案<br>"+
										"3、您已经是正式员工，无需转正");
							}
						}
					});
					var submit = $("#standard_form").form('enableValidation').form('validate');
					if (submit) {
						$.messager.confirm('消息', '您确定上传该流程吗？上传后无法修改！', function(r){
							if (r) {
								$("#standard_form").submit();
							}
						})
					}
				}
			});
		})
	</script>
	<div class="easyui-layout" fit="true">
		<div data-options="region:'center'" align="center" style="border: none;">
			<form id="standard_form" method="post">
				<table class="table" style="margin:10px; width: 70%" border="0" cellpadding="0" cellspacing="0">
				<thead>
					<tr align="center">
						<th colspan="5" style="font-size: 17px">转正申请单</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>
							<!-- emp_name 申请人姓名 -->
							<input name="empName" class="easyui-textbox" labelAlign="right"
								style="width: 30%;" label="申请人：" editable="false" >
							<!-- 申请时间 -->
							<input name="standardUptime" class="easyui-textbox" labelAlign="right"
								style="width: 30%;" label="申请时间：" readonly="readonly"></input>
							<!-- dept_name 部门名称 -->
							<input name="deptName" class="easyui-textbox" labelAlign="right"
								style="width: 30%;" label="部门：" editable="false">
							<!-- 隐藏的部门和员工id -->
							<input name="deptId" type="hidden">
							<input name="empId"  type="hidden">
						</td>
					</tr>
					<tr>
						<td>
							<!--standard_entertime 入职日期 -->
							<input name="standardEntertime" class="easyui-datebox" labelAlign="right"
								style="width:30%;" label="入职日期：" readonly="readonly">
							<!-- standard_trialtime 试用到期日 -->
							<input name="standardTrialtime" class="easyui-datebox" labelAlign="right"
								style="width:30%;" label="试用到期日：" readonly="readonly" labelWidth="101%" >
							<!-- standard_time 申请转正日 -->
							<input name="standardTime" label="申请转正日：" class="easyui-datebox" required
								style="width:30%;"  editable="false" labelWidth="101%" labelAlign="right">
						</td>
					</tr>
					<tr>
						<td>
							<!-- standard_explain 转正申请说明 -->
							<input name="standardExplain" class="easyui-textbox" style="width:80%;height:100px;" label="转正申请说明："
								multiline="true" labelWidth="120%" required labelAlign="right">
							<input name="lunchPeople" type="hidden">
						</td>
					</tr>
					<tr>
						<td style="text-align: center">
							<a id="standard_save" class="easyui-linkbutton"
								data-options="iconCls:'icon-save',text:'暂存'"></a>
							<a id="standard_submit" class="easyui-linkbutton"
								data-options="iconCls:'icon-submit',text:'提交'"></a>
						</td>
					</tr>
				</tbody>
				</table>
			</form>
		</div>
	</div>
</body>
</html>